package org.xxkk.util;

/**
 * @author xxkk
 * @version 1.0.0
 * @title OSCheck
 * @description ʕ•ᴥ•ʔ
 * @create 2024/6/20 16:00
 **/
public class OSCheck {
    public static boolean isMac() {//Mac操作系统
        String osName = System.getProperty("os.name").toLowerCase();
        return osName.contains("mac");
    }

    public static boolean isWin() {//Windows操作系统
        String osName = System.getProperty("os.name").toLowerCase();
        return osName.contains("win");
    }

    public static boolean isUnixOrLinux() {//Unix/Linux操作系统
        String osName = System.getProperty("os.name").toLowerCase();
        return osName.contains("nix") || osName.contains("nux") || osName.contains("aix");
    }

    public static void main(String[] args) {
        String osName = System.getProperty("os.name").toLowerCase();
        System.out.println(osName);
        System.out.println(isMac());
    }
}
